﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NHibernateLibrary.Entities" assembly="NHibernateLibrary">

  <class name="Salary" table="SALARY" check="(MINSALARY > 0 AND MAXSALARY > 0)">

    <composite-id>
      <key-property name="Id" column="Id" type="Int64">
        <column name="Id" unique="true" not-null="true"/>
      </key-property>
      <key-many-to-one name="CompanyDesignationId" class="CompanyDesignation" >
        <column name="COMPANYDESIGNATIONID" />
        <column name="CompanyId" />
        <column name="DESIGNATION" />
      </key-many-to-one>
    </composite-id>

    <property name="MinSalary" column="MINSALARY" length="10" precision="2" >
      <column name="MinSalary" default="0"></column>
    </property>
    <property name="AvgSalary" column="AVGSALARY" length="10" precision="2">
      <column name="AvgSalary" default="0"></column>
    </property>
    <property name="MaxSalary" column="MAXSALARY" length="10" precision="2">
      <column name="MaxSalary" default="0"></column>
    </property>

  </class>

</hibernate-mapping>